package com.ljw.weixin.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.ljw.weixin.R;

import com.ljw.weixin.R;

public class MainActivity extends Activity {
	private Button startButton, stopButton;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mainview);
		startButton = (Button)findViewById(R.id.start);
		stopButton = (Button)findViewById(R.id.stop);
		
		
		final Intent intent = new Intent();
		intent.setAction("com.ljw.weixin.service.DetectWeixinMsgService");
		
		startButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				bindService(intent, null, 0);
			}
		});
		
		stopButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				stopService(intent);	
			}
		});
	}
}
